﻿using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;


namespace user.admin.cyt369.com.services.Services
{
    public class AppService : admin.cyt369.com.services.ORM.BaseService<AppService>
    {
        public AppService() { }

        #region App
        public IQueryable<cyt369.com.services.Models.App> GetApps(int page, int rows, ref int total)
        {
            var items = base.Get<cyt369.com.services.Models.App>();

            return this.Pagination(page, rows, ref total, items, c => c.Id);
        }

        public cyt369.com.services.Models.App GetAppByID(long id)
        {
            return base.GetOne<cyt369.com.services.Models.App>(c => c.Id == id);
        }

        public bool SaveApp(cyt369.com.services.Models.App app)
        {
            return this.Save<cyt369.com.services.Models.App>(app, c => c.Id == app.Id);
        }

        public bool DeleteApp(long id)
        {

            return base.Delete<cyt369.com.services.Models.App>(c => c.Id == id);
        }
        #endregion

    }
}
